package 通信;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class user {
    public static void main(String[] args) throws IOException {
        Socket user = new Socket("192.168.3.4",9090);

        OutputStream outputStream = user.getOutputStream();

        outputStream.write("优雅永不过时".getBytes());

        InputStream inputStream = user.getInputStream();
        byte[] buf = new byte[1024];
        int len = inputStream.read(buf);
        System.out.println(new String(buf,0,len));

        inputStream.close();
        outputStream.close();
        user.close();
    }
}
